package cn.edu.nju.software.service.intf;

import java.sql.SQLException;
import java.text.ParseException;
import java.util.Date;
import java.util.List;

import cn.edu.nju.software.bean.storage.Book;

public interface BookService {
	/**
	 * 取得所有书籍
	 */
	public abstract List<Book> getAllBooks() throws SQLException;
	
	/**
	 * 根据preference文件设置取得热销书籍
	 */
	public abstract List<Book> getHotBooks() throws SQLException, ParseException;

	/**
	 * 根据preference文件设置取得新上架的书籍
	 */
	public abstract List<Book> getRecentBooks() throws SQLException, ParseException;
	
	/**
	 * 根据给定的条件查询书籍
	 */
	public abstract List<Book> searchBooks(String isbn, String title, String author, String publisher, 
			Date beginDate, Date endDate, int category) throws SQLException;
	
	/**
	 * 新增书籍
	 */
	public abstract int addBook(Book book) throws SQLException;
	
	/**
	 * 删除书籍
	 */
	public abstract boolean deleteBook(int bookID) throws SQLException;
	
	/**
	 * 修改书籍信息
	 */
	public abstract int modifyBookInfo(Book book) throws SQLException;

	/**
	 * 根据id取得书籍
	 */
	public abstract Book getBookById(int bookID) throws SQLException;
}
